package com.margo.project.web.session.configuration;


import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory;
import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer;
import org.springframework.data.redis.serializer.RedisSerializer;
import org.springframework.session.data.redis.config.annotation.web.http.EnableRedisHttpSession;



/**
 * springSessionRepositoryFilter
 * @author fxb208
 *
 */
//@Configuration
//@EnableRedisHttpSession
public class MargoSessionConfiguration {
	
	
	@Bean
	public LettuceConnectionFactory connectionFactory() {
		return new LettuceConnectionFactory(); 
	}

	
	/**
	 * RedisHttpSessionConfiguration 注入defaultRedisSerializer
	 * @return
	 */
	@Bean
	public RedisSerializer<Object> defaultRedisSerializer(){
		return new Jackson2JsonRedisSerializer<>(Object.class);
	}

}
